package cn.aylog.controller;

import cn.aylog.pojo.User;
import cn.aylog.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/getById")
    @ResponseBody
    public String getById(@RequestBody User user) {
        System.out.println(user);
        user = userService.getById(55);
        System.out.println(user);
        return user.toString();
    }
}
